package backend

import (
	"github.com/gin-gonic/gin"
	"naio/errs"
	"naio/pkg/casbin"
)

func (h *Handler) RoleBrowse(c *gin.Context) {}

func (h *Handler) RoleFetch(c *gin.Context)  {}

func (h *Handler) RoleUpdate(c *gin.Context) {}

func (h *Handler) RoleDelete(c *gin.Context) {}

func (h *Handler) PermissionAdd(c *gin.Context) {
	e := casbin.Setup()
	if ok, _ := e.AddPolicy("admin", "/backend/auth/info", "GET"); !ok {
		panic(errs.NewMyAPIError(errs.ERROR, "规则已经存在"))
	}
}
